package cn.xo68.sample.elkdemo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HomeController {

    private final static Logger logger=LoggerFactory.getLogger(HomeController.class);
    
    @GetMapping({"/",""})
    public String index() {
        logger.info("在{}，访问了应用首页", System.currentTimeMillis());
        logger.error("在{}，访问应用首页时异常", System.currentTimeMillis());
        return "success";
    }
}
